import java.util.*;

/**
 * @author LKQ
 * @date 2022/2/25 10:48
 * @description
 */
public class Solution {
    public static void main(String[] args) {

    }
    public int countPoints(String rings) {
        Map<Integer, Set<String>> map = new HashMap<>();
        char[] ring = rings.toCharArray();
        for (int i = 0; i <= 9; i++) {
            map.put(i, new HashSet<>());
        }
        for (int i = 0; i < ring.length; i++) {
            if (ring[i] >= 48 && ring[i] <= 57) {
                // 为数字
                map.get(ring[i] - 48).add(String.valueOf(ring[i-1]));
            }
        }
        int sum = 0;
        for (int i = 0; i <= 9; i++) {
            if (map.get(i).size() == 3) {
                sum++;
            }
        }
        return sum;
    }
}
